package com.authine.cloudpivot.ext.dto.model.trade;


import com.authine.cloudpivot.ext.utils.StringUtils;
import com.authine.common.json.JsonUtils;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class TradeExtendsAttr implements Serializable {
    private static final long serialVersionUID = -3793815217743823708L;
    /**
     * 开票后多少天结算
     */
    private Integer settlementStrategy;

    /**
     * 询价时间
     */
    private String inquiryTime;

    /**
     * 对接外部工厂代码
     */
    private String clientFactoryCode;

    /**
     * 客服工作台预计开票时间
     */
    private Date workBenchInvoiceDate;
    /**
     * 客服工作台未开票原因
     */
    private String workBenchInvoiceReason;

    public static TradeExtendsAttr conversion(String value) {
        if(StringUtils.isNotBlank(value)){
            return JsonUtils.toObject(value, TradeExtendsAttr.class);
        }
        return null;

    }

}
